<!--
 * @Author: wangwang 2723008256@qq.com
 * @Date: 2022-05-11 15:26:59
 * @LastEditors: wangwang 2723008256@qq.com
 * @LastEditTime: 2022-05-19 08:56:35
 * @FilePath: \jzjypc4.0\src\views\PersonalCenter\PersonalMsg\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <!-- 个人中心/学校数据 -->
  <div id="container">
    <div class="top">
      <span></span>
      <h3>学校数据</h3>
    </div>
    <div class="content">
      <div class="left">
        <el-menu
          router
          default-active="/personal/SchoolData"
          class="el-menu-vertical-demo"
          background-color="#FFFFFF"
          text-color="#646566"
          active-text-color="#08A579"
          @select="schooldataChange"
        >
          <el-menu-item index="/personal/SchoolData">
            <span slot="title">
              <span class="tips" v-if="tips == 1"></span>
              整体数据
            </span>
          </el-menu-item>
          <el-menu-item index="/personal/SchoolData/ActiveData">
            <span slot="title">
              <span class="tips" v-if="tips == 2"></span>
              活动数据
            </span>
          </el-menu-item>
          <el-menu-item index="/personal/SchoolData/ResourceData">
            <span slot="title">
              <span class="tips" v-if="tips == 3"></span>
              资源数据
            </span>
          </el-menu-item>
          <el-menu-item index="/personal/SchoolData/ProductData">
            <span slot="title">
              <span class="tips" v-if="tips == 4"></span>
              产品数据
            </span>
          </el-menu-item>
        </el-menu>
      </div>
      <div class="right">
        <router-view />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "changeClass",
  components: {},
  data() {
    return {
      tips: 1,
    };
  },
  methods: {
    schooldataChange  (key) {
      console.log(key);
      if (key == "/personal/SchoolData") {
        this.tips = 1;
      } else if (key == "/personal/SchoolData/ActiveData") {
        this.tips = 2;
      } else if (key == "/personal/SchoolData/ResourceData") {
        this.tips = 3;
      } else if (key == "/personal/SchoolData/ProductData") {
        this.tips = 4;
      }
    },
  },
};
</script>

<style lang="less" scoped>
#container {
  .top {
    display: flex;
    margin: 30px 0px 40px 30px;
    span {
      display: inline-block;
      position: relative;
      top: 5px;
      margin-right: 10px;
      width: 3px;
      height: 20px;
      background: #08a579;
      border-radius: 2px;
    }
    h3 {
      font-size: 20px;
    }
  }
  .content {
    display: flex;
    .left {
      margin-left: 30px;
      .el-menu {
        border-right: 0;
      }
      .el-menu-item {
        margin-bottom: 10px;
        text-align: center;
        padding: 0 !important;
        margin-right: 20px;
        width: 140px;
        height: 40px;
        font-size: 16px;
        line-height: 40px;
      }
      .tips {
        display: inline-block;
        position: relative;
        left: -35px;
        top: -3px;
        width: 2px;
        height: 40px;
        background: #08a579;
      }
      .is-active {
        background-color: #f0faf7 !important;
      }
    }
  }
}
</style>
